﻿namespace SLClient.Resource.Converters
{
    using System;
    using System.Globalization;
    using System.Windows.Data;

    public class IntToImageConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            int num = System.Convert.ToInt32(value);
            if (parameter.ToString() == "liter")
            {
                switch (num)
                {
                    case 0:
                        return "信息";

                    case 1:
                        return "提醒";

                    case 2:
                        return "公告";
                }
                return "信息";
            }
            switch (num)
            {
                case 0:
                    return new Uri("/SLClient;component/Images/msg0.png", UriKind.RelativeOrAbsolute);

                case 1:
                    return new Uri("/SLClient;component/Images/msg1.png", UriKind.RelativeOrAbsolute);

                case 2:
                    return new Uri("/SLClient;component/Images/msg2.png", UriKind.RelativeOrAbsolute);
            }
            return new Uri("/SLClient;component/Images/msg0.png", UriKind.RelativeOrAbsolute);
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}

